<?php

namespace App\Http\Controllers;

use App\Library\Requests\Address\AddressAddRequest;
use App\Library\Requests\Address\AddressEditRequest;
use App\Library\Requests\Base\BasePageRequest;
use App\Library\Requests\Base\IdRequest;
use App\Library\Service\AddressService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class AddressController extends BaseController
{
    public function __construct(AddressService $service)
    {
        return $this->service = $service;
    }

    /**
     *
     * add
     * @param AddressAddRequest $request
     * @return JsonResponse
     *
     */
    public function add(AddressAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     *
     * edit
     * @param AddressEditRequest $request
     * @return JsonResponse
     *
     */
    public function edit(AddressEditRequest $request): JsonResponse
    {
        return $this->service->edit($request);
    }

    /**
     *
     * delete
     * @param IdRequest $request
     * @return JsonResponse
     *
     */
    public function delete(IdRequest $request): JsonResponse
    {
        return $this->service->delete($request);
    }

    /**
     * paging
     * @param BasePageRequest $request
     * @return JsonResponse
     *
     */
    public function paging(BasePageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * default
     * @param IdRequest $request
     * @return JsonResponse
     *
     */
    public function default(IdRequest $request): JsonResponse
    {
        return $this->service->default($request);
    }

    /**
     * defaultInfo
     * @return JsonResponse
     *
     */
    public function defaultInfo(): JsonResponse
    {
        return $this->service->defaultInfo();
    }
}
